package cn.pzhu.java.ch03.inheritance;


class Stars extends Object{
	private char displayChar;
	private int rows;
	public Stars(char displayChar, int rows) {
		super();
		this.displayChar = displayChar;
		this.rows = rows;
	}
	public String toString(){
		String buf="";
		for(int i=1;i<=rows;i++){
			for(int j=1;j<=i;j++){
				buf+=this.displayChar+" ";
			}
			buf+="\n";
		}
		return buf;
	}
	
}
public class SuperClassObejct {

	
	public static void main(String[] args) {
		Stars stars=new Stars('*', 5);
		System.out.println(stars);
	}

}
